package com.train.mgr.modules.biz.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.train.mgr.modules.biz.entity.CourseStuGroup;
import com.train.mgr.modules.biz.entity.CourseStuGroupRel;
import com.train.mgr.modules.biz.mapper.CourseStuGroupRelMapper;
import com.train.mgr.modules.biz.service.ICourseStuGroupRelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 * 课程学员分组关系表 服务实现类
 * </p>
 *
 * @author cxg
 * @date 2025-10-02
 */
@Slf4j
@RequiredArgsConstructor
@Service("ICourseStuGroupRelService")
public class CourseStuGroupRelServiceImpl extends ServiceImpl<CourseStuGroupRelMapper, CourseStuGroupRel> implements ICourseStuGroupRelService {


    @Override
    public long findCourseGroupStuNum(Long groupId,Long courseId){
        LambdaQueryWrapper<CourseStuGroupRel> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(CourseStuGroupRel::getCourseId,courseId);
        queryWrapper.eq(CourseStuGroupRel::getGroupId,groupId);
        return baseMapper.selectCount(queryWrapper);
    }

}
